extends ../layouts/main
include ../partials/older-version-select

block header-logo
	include ../partials/header/header-logo

block header-menu
	include ../partials/header/header-menu

block main
	.clearfix.wrapper.builder

		div.header.clearfix
			h1 Download complete source
			form(method="post", action="/builder")
				input(hidden, name="project", value="#{project}")
				.save

					label
						input(type="checkbox", name="minified", value="1")
						| Download minified source code

					label
						input(type="checkbox", name="compat", value="1")
						| Download with compat layer

					if project != 'Core'
						label.select
							select(name="removeCoreDependencies")
								option(value="removeAll") Do not add Core
								option(value="removeNone") Add Core (full)
								option(value="keepDependencies") Add Core (only dependencies)

					label
						a.button.highlighted.getFile(href='#')
							span Download MooTools #{project}
							span.version Ver. #{version}
							span.icon.download(aria-hidden='true')

		div.header.clearfix
			h1 Download your customized version

			h3 Choose which modules you want to use

		form#builderOptions(method="post", action="/builder")
			input(hidden, name="project", value="#{project}")
			table
				tr
					td
					td File
					td Provides
					td Description

				each yaml, module in dependencies
					- var file = project + "/" + module;
					- var hashRequested = hashDependencies.indexOf(file) != -1;
					tr
						td
							input(type="checkbox", value=file, name="modules[]", data-provides="#{yaml.prov}", data-requires="#{yaml.req}", checked=hashRequested, class=hashRequested ? "activeChoice" : "")
						td #{module}
						td #{yaml.prov}
						td #{yaml.desc}

			h2.step Options:

			.save
				label
					input(type="checkbox", name="minified", value="1")
					| Download minified source code

				label
					input(type="checkbox", name="compat", value="1")
					| Download with compat layer

				if project != 'Core'
					label.select
						select(name="removeCoreDependencies")
							option(value="removeAll") Do not add Core
							option(value="removeNone") Add Core (full)
							option(value="keepDependencies") Add Core (only dependencies)

				label
					a.button.highlighted.getFile(href='#')
						span Download custom MooTools #{project}
						span.version Ver. #{version}
						span.icon.download(aria-hidden='true')

	.clearfix.wrapper.builder
		if (navigation == 'core')
			div.header.clearfix
				h1 Older versions of MooTools
				mixin older-version-select(versions)
